#ifndef __DRV_ADC_H
#define __DRV_ADC_H

#ifdef __cplusplus
extern "C" {
#endif

#include "mm32_device.h"
#include "hal_conf.h"

#define ADC_USE ADC1

#define ADC_CHANNEL_NUM 3

#define RV1_PORT		GPIOA
#define RV1_PIN 		GPIO_Pin_5
#define RV1_CHARNNEL	ADC_Channel_5

#define RV2_PORT		GPIOA
#define RV2_PIN 		GPIO_Pin_1
#define RV2_CHARNNEL 	ADC_Channel_1

#define RV3_PORT		GPIOA
#define RV3_PIN 		GPIO_Pin_4
#define RV3_CHARNNEL 	ADC_Channel_4


#define adc_gpio_clkopen() {	\
    RCC_AHBPeriphClockCmd(RCC_AHBENR_GPIOA, ENABLE);	\
};

typedef struct adc_gpio
{
	uint16_t pin;
	GPIO_TypeDef *gpio;
}adc_gpio;


void adc_init(void);


#ifdef __cplusplus
}
#endif


#endif

